<?php
namespace app\api\controller;

use think\Controller;
use app\api\model\User;

class Users extends Controller
{

    /**
     * 查询用户的余额或积分
     */
    public function moneyint()
    {
        if (request()->isGet()){
            AjaxReturn('10020','传值方式错误');
            die;
        }
        if(request()->isPost()) {
            $userid = input('id');
            $type = input('type');
            $user = new User();
            $data = $user->moneyint($userid, $type);
            if ($data == 0) {
                AjaxReturn('10016', '暂未查到该用户的信息');
            } else {
                AjaxReturn('1', '成功', ['details' => $data]);
            }
        }
    }

    
}